import type { ThemeComponents } from '@/api/modules/lcd/theme.components';
import type { Rule } from 'ant-design-vue/es/form';

const formObj: ThemeComponents = {
  width: 0,
  height: 0,
  scale: 0,
  imgSrc: '',
  deptId: '',
  templateId: '',
  templateName: '',
  templateData: '',
  major: undefined,
};
export const form = ref({
  ...formObj,
});

export const formRef = ref();

export const resetForm = () => {
  form.value = {
    ...formObj,
  };
};
export const formRules: Record<keyof ThemeComponents, Rule[]> = {
  width: [],
  height: [],
  scale: [],
  imgSrc: [],
  deptId: [],
  templateId: [],
  templateName: [{ required: true }],
  templateData: [],
  major: [],
  templateList: [],
};
